﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IntelliLance.Math.Parser
{
    /// <summary>
    /// Provides the necessary information the token processor needs to process a token.
    /// </summary>
    /// <remarks>Each time the ITokenProcessor.ProcessToken is called by the parser, a new instance 
    /// of this class is created with the appropriate data, including the underlying token, its zero-based 
    /// position in the input string, and the parser settings instance used by the parser itself.</remarks>
    public class TokenContext
    {
        public TokenContext(Token token, MathParserOptions options, int relativePosition)
        {
            if (token == null)
                ThrowHelpers.ThrowNullArgument("token");
            if (options == null)
                ThrowHelpers.ThrowNullArgument("options");

            Token = token;
            ParserOptions = options;
            ParserRelativePosition = relativePosition;

        }
        public Token Token { get; private set; }
        public MathParserOptions ParserOptions { get; private set; }
        public int ParserRelativePosition { get; private set; }
    }
}
